<?php

use app\model\Category;
use app\model\Nav;
use app\model\Post;
use app\model\PostCategory;
use app\model\SystemConfig;
use app\model\UploadFiles;
use think\migration\Seeder;

class InitDemo extends Seeder
{
  /**
   * Run Method.
   *
   * Write your database seeder using this method.
   *
   * More information on writing seeders is available here:
   * http://docs.phinx.org/en/latest/seeding.html
   */
  public function run()
  {

    $root_path = app()->getRootPath();

    $this->copyDir($root_path . 'demodata/upload', $root_path . 'public/upload');

    $this->initCategory();
    $this->initNav();
    $this->initPost();
    $this->initPostCategory();
    $this->initSystemConfig();
    $this->initUploadFiles();
  }

  public function copyDir($dir, $toDir)
  {

    if (is_file($toDir)) {
      echo "对不起，您是一个文件";
      exit();
    } else {
      //判断复制目录是否存在 ，如果不存在则创建目录
      if (!file_exists($toDir)) {
        mkdir($toDir);
      } else {
        $dirName = opendir($dir);
        while ($fileName = readdir($dirName)) {
          if ($fileName != "." && $fileName != "..") {
            $dirUrl = $dir . "/" . $fileName;
            $dirToUrl = $toDir . "/" . $fileName;
            if (is_dir($dirUrl)) {
              $this->copydir($dirUrl, $dirToUrl);
            } else {
              copy($dirUrl, $dirToUrl);
            }
          }
        }
        closedir($dirName);
      }
    }
  }

  public function initCategory()
  {
    $data_content = '
    {
      "ul_category": [
        {
          "id" : 1,
          "title" : "产品展示",
          "create_time" : 1596799597,
          "update_time" : 1596799986,
          "delete_time" : 0,
          "pid" : 0,
          "level" : 1,
          "tpl_name" : "_product",
          "title_img" : "upload\/article\/5f2d3bf142a3f.jpg",
          "desc" : "",
          "status" : 1,
          "type" : "2"
        },
        {
          "id" : 2,
          "title" : "成功案例",
          "create_time" : 1596799606,
          "update_time" : 1596800425,
          "delete_time" : 0,
          "pid" : 0,
          "level" : 1,
          "tpl_name" : "_case",
          "title_img" : "upload\/article\/5f2d3da78c4d0.jpg",
          "desc" : "",
          "status" : 1,
          "type" : "2"
        },
        {
          "id" : 3,
          "title" : "实时新闻",
          "create_time" : 1596799616,
          "update_time" : 1596800053,
          "delete_time" : 0,
          "pid" : 0,
          "level" : 1,
          "tpl_name" : "",
          "title_img" : "upload\/article\/5f2d3c34b8de0.jpg",
          "desc" : "",
          "status" : 1,
          "type" : "2"
        },
        {
          "id" : 4,
          "title" : "关于我们",
          "create_time" : 1596799623,
          "update_time" : 1596799943,
          "delete_time" : 0,
          "pid" : 0,
          "level" : 1,
          "tpl_name" : "",
          "title_img" : "upload\/article\/5f2d3bc64acf9.jpg",
          "desc" : "",
          "status" : 1,
          "type" : "2"
        },
        {
          "id" : 5,
          "title" : "公司简介",
          "create_time" : 1596799634,
          "update_time" : 1596799634,
          "delete_time" : 0,
          "pid" : 4,
          "level" : 2,
          "tpl_name" : "_about_1",
          "title_img" : "",
          "desc" : "",
          "status" : 1,
          "type" : "2"
        },
        {
          "id" : 6,
          "title" : "招贤纳士",
          "create_time" : 1596799643,
          "update_time" : 1596800639,
          "delete_time" : 0,
          "pid" : 4,
          "level" : 2,
          "tpl_name" : "_about_2",
          "title_img" : "",
          "desc" : "奥宏网络科技\r\n奥宏网络科技\r\n奥宏网络科技\r\n",
          "status" : 1,
          "type" : "2"
        },
        {
          "id" : 7,
          "title" : "发展进程",
          "create_time" : 1596799654,
          "update_time" : 1596799654,
          "delete_time" : 0,
          "pid" : 4,
          "level" : 2,
          "tpl_name" : "_about_3",
          "title_img" : "",
          "desc" : "",
          "status" : 1,
          "type" : "2"
        }
      ]}
      
    ';

    $list = json_decode($data_content, true);
    foreach ($list['ul_category'] as $item) {
      Category::create($item);
    }
  }

  public function initNav()
  {

    $data_content = '{
      "ul_nav": [
        {
          "id" : 1,
          "title" : "产品",
          "sort" : 0,
          "create_time" : 1596798507,
          "update_time" : 1596800241,
          "delete_time" : 0,
          "type" : "10",
          "img" : "",
          "desc" : "",
          "target" : "_self",
          "xcx_type" : 0,
          "value" : "\/index\/Category\/read.html?id=1",
          "xcx_appid" : "",
          "status" : 1
        },
        {
          "id" : 2,
          "title" : "案例",
          "sort" : 0,
          "create_time" : 1596798564,
          "update_time" : 1596800248,
          "delete_time" : 0,
          "type" : "10",
          "img" : "",
          "desc" : "",
          "target" : "_self",
          "xcx_type" : 0,
          "value" : "\/index\/Category\/read.html?id=2",
          "xcx_appid" : "",
          "status" : 1
        },
        {
          "id" : 3,
          "title" : "动态",
          "sort" : 0,
          "create_time" : 1596798574,
          "update_time" : 1596800256,
          "delete_time" : 0,
          "type" : "10",
          "img" : "",
          "desc" : "",
          "target" : "_self",
          "xcx_type" : 0,
          "value" : "\/index\/Category\/read.html?id=3",
          "xcx_appid" : "",
          "status" : 1
        },
        {
          "id" : 4,
          "title" : "关于",
          "sort" : 0,
          "create_time" : 1596798591,
          "update_time" : 1596800494,
          "delete_time" : 0,
          "type" : "10",
          "img" : "",
          "desc" : "",
          "target" : "_self",
          "xcx_type" : 0,
          "value" : "\/index\/Category\/read.html?id=5",
          "xcx_appid" : "",
          "status" : 1
        },
        {
          "id" : 5,
          "title" : "首页",
          "sort" : 0,
          "create_time" : 1596798600,
          "update_time" : 1596798600,
          "delete_time" : 0,
          "type" : "10",
          "img" : "",
          "desc" : "",
          "target" : "_self",
          "xcx_type" : 0,
          "value" : "\/",
          "xcx_appid" : "",
          "status" : 1
        },
        {
          "id" : 6,
          "title" : "CSS处理",
          "sort" : 0,
          "create_time" : 1596798684,
          "update_time" : 1596798684,
          "delete_time" : 0,
          "type" : "6",
          "img" : "upload\/nav\/5f2d36d3d3d1d.png",
          "desc" : "",
          "target" : "_self",
          "xcx_type" : 0,
          "value" : "",
          "xcx_appid" : "",
          "status" : 1
        },
        {
          "id" : 7,
          "title" : "兼容性",
          "sort" : 0,
          "create_time" : 1596798862,
          "update_time" : 1596798862,
          "delete_time" : 0,
          "type" : "6",
          "img" : "upload\/nav\/5f2d378d41c52.png",
          "desc" : "",
          "target" : "_self",
          "xcx_type" : 0,
          "value" : "",
          "xcx_appid" : "",
          "status" : 1
        },
        {
          "id" : 8,
          "title" : "响应式",
          "sort" : 0,
          "create_time" : 1596798931,
          "update_time" : 1596798931,
          "delete_time" : 0,
          "type" : "6",
          "img" : "upload\/nav\/5f2d37d2a30d6.png",
          "desc" : "",
          "target" : "_self",
          "xcx_type" : 0,
          "value" : "",
          "xcx_appid" : "",
          "status" : 1
        },
        {
          "id" : 9,
          "title" : "1对1使用指导",
          "sort" : 0,
          "create_time" : 1596798987,
          "update_time" : 1596799062,
          "delete_time" : 0,
          "type" : "7",
          "img" : "upload\/nav\/5f2d3809e5255.jpg",
          "desc" : "更有多个包含不同主题的Web组件，可快速构建界面出色、体验优秀的跨屏页面，大幅提升开发效率。",
          "target" : "_self",
          "xcx_type" : 0,
          "value" : "",
          "xcx_appid" : "",
          "status" : 1
        },
        {
          "id" : 10,
          "title" : "1对1使用指导",
          "sort" : 0,
          "create_time" : 1596798997,
          "update_time" : 1596799074,
          "delete_time" : 0,
          "type" : "7",
          "img" : "upload\/nav\/5f2d38144d692.jpg",
          "desc" : "更有多个包含不同主题的Web组件，可快速构建界面出色、体验优秀的跨屏页面，大幅提升开发效率。",
          "target" : "_self",
          "xcx_type" : 0,
          "value" : "",
          "xcx_appid" : "",
          "status" : 1
        },
        {
          "id" : 11,
          "title" : "1对1使用指导",
          "sort" : 0,
          "create_time" : 1596799021,
          "update_time" : 1596799079,
          "delete_time" : 0,
          "type" : "7",
          "img" : "upload\/nav\/5f2d382c98e12.jpg",
          "desc" : "更有多个包含不同主题的Web组件，可快速构建界面出色、体验优秀的跨屏页面，大幅提升开发效率。",
          "target" : "_self",
          "xcx_type" : 0,
          "value" : "",
          "xcx_appid" : "",
          "status" : 1
        },
        {
          "id" : 12,
          "title" : "1对1使用指导",
          "sort" : 0,
          "create_time" : 1596799028,
          "update_time" : 1596799084,
          "delete_time" : 0,
          "type" : "7",
          "img" : "upload\/nav\/5f2d3833a402d.jpg",
          "desc" : "更有多个包含不同主题的Web组件，可快速构建界面出色、体验优秀的跨屏页面，大幅提升开发效率。",
          "target" : "_self",
          "xcx_type" : 0,
          "value" : "",
          "xcx_appid" : "",
          "status" : 1
        },
        {
          "id" : 13,
          "title" : "百度",
          "sort" : 0,
          "create_time" : 1596799393,
          "update_time" : 1596799393,
          "delete_time" : 0,
          "type" : "2",
          "img" : "",
          "desc" : "",
          "target" : "_self",
          "xcx_type" : 0,
          "value" : " \twww.baidu.com",
          "xcx_appid" : "",
          "status" : 1
        },
        {
          "id" : 14,
          "title" : "奥宏网络科技",
          "sort" : 0,
          "create_time" : 1596799415,
          "update_time" : 1596799415,
          "delete_time" : 0,
          "type" : "3",
          "img" : "upload\/nav\/5f2d39b6b49da.jpg",
          "desc" : "",
          "target" : "_self",
          "xcx_type" : 0,
          "value" : "",
          "xcx_appid" : "",
          "status" : 1
        },
        {
          "id" : 15,
          "title" : "奥宏网络科技",
          "sort" : 0,
          "create_time" : 1596799427,
          "update_time" : 1596799427,
          "delete_time" : 0,
          "type" : "3",
          "img" : "upload\/nav\/5f2d39c21ca75.jpg",
          "desc" : "",
          "target" : "_self",
          "xcx_type" : 0,
          "value" : "",
          "xcx_appid" : "",
          "status" : 1
        }
      ]}
      ';

    $list = json_decode($data_content, true);

    foreach ($list['ul_nav'] as $item) {
      Nav::create($item);
    }
  }

  public function initPost()
  {
    $data_content = '{
      "ul_post": [
        {
          "id" : 1,
          "title" : "奥宏网络科技",
          "poster" : "upload\/article\/5f2d3ca931e3e.jpg",
          "create_time" : 1596800193,
          "update_time" : 1596800403,
          "delete_time" : 0,
          "content" : "[{\"insert\":\"\\n\"}]",
          "content_html" : "<p><br><\/p>",
          "desc" : "奥宏网络科技奥宏网络科技奥宏网络科技奥宏网络科技奥宏网络科技奥宏网络科技奥宏网络科技奥宏网络科技",
          "is_top" : 0,
          "status" : 0,
          "publish_time" : 1596729600,
          "hits" : 0,
          "jump_to_url" : "",
          "jump_to_url_status" : 1,
          "sort" : 0,
          "type" : "2",
          "files" : "",
          "pictures" : "",
          "tpl_name" : ""
        },
        {
          "id" : 2,
          "title" : "微信摇奖",
          "poster" : "upload\/article\/5f2d3d5c2a3f4.jpg",
          "create_time" : 1596800357,
          "update_time" : 1596800374,
          "delete_time" : 0,
          "content" : "[{\"insert\":\"\\n\"}]",
          "content_html" : "<p><br><\/p>",
          "desc" : "一家工厂企业的商品展示网站，主要以卖高端服饰为主。主要以卖高端服饰为主。主要以卖高端服饰为主。",
          "is_top" : 0,
          "status" : 0,
          "publish_time" : 1596729600,
          "hits" : 0,
          "jump_to_url" : "",
          "jump_to_url_status" : 1,
          "sort" : 0,
          "type" : "2",
          "files" : "",
          "pictures" : "",
          "tpl_name" : ""
        },
        {
          "id" : 3,
          "title" : "这家引爆ins的奶茶店终于空降南昌，开放加盟啦！",
          "poster" : "",
          "create_time" : 1596800455,
          "update_time" : 1596800462,
          "delete_time" : 0,
          "content" : "[{\"insert\":\"\\u8fd9\\u5bb6\\u5f15\\u7206ins\\u7684\\u5976\\u8336\\u5e97\\u7ec8\\u4e8e\\u7a7a\\u964d\\u5357\\u660c\\uff0c\\u5f00\\u653e\\u52a0\\u76df\\u5566\\uff01\"},{\"attributes\":{\"header\":\"1\"},\"insert\":\"\\n\"},{\"insert\":\"\\n\"}]",
          "content_html" : "<h1>这家引爆ins的奶茶店终于空降南昌，开放加盟啦！<\/h1><p><br><\/p>",
          "desc" : "这家引爆ins的奶茶店终于空降南昌，开放加盟啦！",
          "is_top" : 0,
          "status" : 0,
          "publish_time" : 1596729600,
          "hits" : 0,
          "jump_to_url" : "",
          "jump_to_url_status" : 1,
          "sort" : 0,
          "type" : "2",
          "files" : "",
          "pictures" : "",
          "tpl_name" : ""
        },
        {
          "id" : 4,
          "title" : "身处在前端社区的繁荣之下，我们都在有意或无意地追逐。而 layui 偏偏回望当初，奔赴在返璞归真的漫漫征途，自信并勇敢着，追寻于原生态的书写指令，试图以最简单的方式诠释高效。",
          "poster" : "upload\/article\/5f2d3e215d5df.jpg",
          "create_time" : 1596800552,
          "update_time" : 1596800552,
          "delete_time" : 0,
          "content" : "[{\"insert\":\"\\n\"}]",
          "content_html" : "<p><br><\/p>",
          "desc" : "身处在前端社区的繁荣之下，我们都在有意或无意地追逐。而 layui 偏偏回望当初，奔赴在返璞归真的漫漫征途，自信并勇敢着，追寻于原生态的书写指令，试图以最简单的方式诠释高效。",
          "is_top" : 0,
          "status" : 0,
          "publish_time" : 0,
          "hits" : 0,
          "jump_to_url" : "",
          "jump_to_url_status" : 1,
          "sort" : 0,
          "type" : "2",
          "files" : "",
          "pictures" : "",
          "tpl_name" : ""
        },
        {
          "id" : 5,
          "title" : "身处在前端社区的繁荣之下，我们都在有意或无意地追逐。而 layui 偏偏回望当初，奔赴在返璞归真的漫漫征途，自信并勇敢着，追寻于原生态的书写指令，试图以最简单的方式诠释高效。",
          "poster" : "upload\/article\/5f2d3e3e8ccad.jpg",
          "create_time" : 1596800575,
          "update_time" : 1596800596,
          "delete_time" : 0,
          "content" : "[{\"insert\":\"\\n\"}]",
          "content_html" : "<p><br><\/p>",
          "desc" : "身处在前端社区的繁荣之下，我们都在有意或无意地追逐。而 layui 偏偏回望当初，奔赴在返璞归真的漫漫征途，自信并勇敢着，追寻于原生态的书写指令，试图以最简单的方式诠释高效。",
          "is_top" : 0,
          "status" : 0,
          "publish_time" : 1596729600,
          "hits" : 0,
          "jump_to_url" : "",
          "jump_to_url_status" : 1,
          "sort" : 0,
          "type" : "2",
          "files" : "",
          "pictures" : "",
          "tpl_name" : ""
        },
        {
          "id" : 6,
          "title" : "前端工程师",
          "poster" : "",
          "create_time" : 1596800735,
          "update_time" : 1596800746,
          "delete_time" : 0,
          "content" : "[{\"insert\":\"\\n\"}]",
          "content_html" : "<p><br><\/p>",
          "desc" : "js,\njq",
          "is_top" : 0,
          "status" : 0,
          "publish_time" : 1596729600,
          "hits" : 0,
          "jump_to_url" : "",
          "jump_to_url_status" : 1,
          "sort" : 0,
          "type" : "2",
          "files" : "",
          "pictures" : "",
          "tpl_name" : ""
        }
      ]}
      ';
    $list = json_decode($data_content, true);

    foreach ($list['ul_post'] as $item) {
      Post::create($item);
    }
  }

  public function initPostCategory()
  {
    $data_content = '{
      "ul_post_category": [
        {
          "id" : 3,
          "post_id" : 2,
          "category_id" : 2,
          "create_time" : 1596800374,
          "update_time" : 1596800374,
          "delete_time" : 0
        },
        {
          "id" : 5,
          "post_id" : 1,
          "category_id" : 1,
          "create_time" : 1596800403,
          "update_time" : 1596800403,
          "delete_time" : 0
        },
        {
          "id" : 6,
          "post_id" : 3,
          "category_id" : 3,
          "create_time" : 1596800462,
          "update_time" : 1596800462,
          "delete_time" : 0
        },
        {
          "id" : 7,
          "post_id" : 4,
          "category_id" : 5,
          "create_time" : 1596800552,
          "update_time" : 1596800552,
          "delete_time" : 0
        },
        {
          "id" : 8,
          "post_id" : 4,
          "category_id" : 7,
          "create_time" : 1596800552,
          "update_time" : 1596800552,
          "delete_time" : 0
        },
        {
          "id" : 11,
          "post_id" : 5,
          "category_id" : 5,
          "create_time" : 1596800596,
          "update_time" : 1596800596,
          "delete_time" : 0
        },
        {
          "id" : 12,
          "post_id" : 5,
          "category_id" : 7,
          "create_time" : 1596800596,
          "update_time" : 1596800596,
          "delete_time" : 0
        },
        {
          "id" : 13,
          "post_id" : 6,
          "category_id" : 6,
          "create_time" : 1596800746,
          "update_time" : 1596800746,
          "delete_time" : 0
        }
      ]}
      ';

    $list = json_decode($data_content, true);

    foreach ($list['ul_post_category'] as $item) {
      PostCategory::create($item);
    }
  }

  public function initSystemConfig()
  {
    $data_content = '{
      "ul_system_config": [
        {
          "id" : 1,
          "name" : "index_tpl_name",
          "value" : "easy_blue_"
        },
        {
          "id" : 2,
          "name" : "easy_index_block_1_title_1",
          "value" : "专为前端而研制的"
        },
        {
          "id" : 3,
          "name" : "easy_index_block_1_title_2",
          "value" : "核心产品"
        },
        {
          "id" : 4,
          "name" : "easy_index_block_2_title_1",
          "value" : "为客户打造完美的"
        },
        {
          "id" : 5,
          "name" : "easy_index_block_2_title_2",
          "value" : "专业服务"
        },
        {
          "id" : 6,
          "name" : "easy_index_bottom_jump_url",
          "value" : ""
        },
        {
          "id" : 7,
          "name" : "site_name",
          "value" : "奥宏官网模板"
        },
        {
          "id" : 8,
          "name" : "site_desc",
          "value" : ""
        },
        {
          "id" : 9,
          "name" : "file",
          "value" : ""
        },
        {
          "id" : 10,
          "name" : "site_logo",
          "value" : "upload\/site_logo\/5f2d3f46a62ac.png"
        },
        {
          "id" : 11,
          "name" : "site_beian",
          "value" : ""
        },
        {
          "id" : 12,
          "name" : "site_safe_beian",
          "value" : ""
        },
        {
          "id" : 13,
          "name" : "site_safe_beian_url",
          "value" : ""
        },
        {
          "id" : 14,
          "name" : "site_copyright",
          "value" : ""
        },
        {
          "id" : 15,
          "name" : "site_contact_phone",
          "value" : ""
        },
        {
          "id" : 16,
          "name" : "site_worktime",
          "value" : ""
        },
        {
          "id" : 17,
          "name" : "stie_contact_email",
          "value" : ""
        },
        {
          "id" : 18,
          "name" : "site_qrcode",
          "value" : ""
        },
        {
          "id" : 19,
          "name" : "site_favicon",
          "value" : ""
        },
        {
          "id" : 20,
          "name" : "main_domain",
          "value" : ""
        },
        {
          "id" : 21,
          "name" : "resource_domain",
          "value" : ""
        },
        {
          "id" : 22,
          "name" : "site_tongji",
          "value" : ""
        }
      ]}
      ';

    $list = json_decode($data_content, true);

    foreach ($list['ul_system_config'] as $item) {
      SystemConfig::create($item);
    }
  }

  public function initUploadFiles()
  {
    $data_content = '{
      "ul_upload_files": [
        {
          "id" : 1,
          "save_name" : "upload\/nav\/5f2d36d3d3d1d.png",
          "file_name" : "5e9bb923e6742.png",
          "mime_type" : "image\/png",
          "file_size" : 2165,
          "ext_name" : "png",
          "file_md5" : "27bab0504c1ffe97b3a0597c47fc4bbf",
          "file_sha1" : "f60c182f6823fa86b03c06c2433871bd8f871097",
          "create_time" : 1596798675,
          "used_time" : 0,
          "delete_time" : 0,
          "clear_time" : 0,
          "type" : 6,
          "status" : 0
        },
        {
          "id" : 2,
          "save_name" : "upload\/nav\/5f2d378d41c52.png",
          "file_name" : "5e9bb94abf741.png",
          "mime_type" : "image\/png",
          "file_size" : 3326,
          "ext_name" : "png",
          "file_md5" : "30c3804c8eeb10fc1021e76a62ebb609",
          "file_sha1" : "c95566725fac8491fe36705f79316a54d340a139",
          "create_time" : 1596798861,
          "used_time" : 0,
          "delete_time" : 0,
          "clear_time" : 0,
          "type" : 6,
          "status" : 0
        },
        {
          "id" : 3,
          "save_name" : "upload\/nav\/5f2d37d2a30d6.png",
          "file_name" : "5e9bb923e6742.png",
          "mime_type" : "image\/png",
          "file_size" : 2165,
          "ext_name" : "png",
          "file_md5" : "27bab0504c1ffe97b3a0597c47fc4bbf",
          "file_sha1" : "f60c182f6823fa86b03c06c2433871bd8f871097",
          "create_time" : 1596798930,
          "used_time" : 0,
          "delete_time" : 0,
          "clear_time" : 0,
          "type" : 6,
          "status" : 0
        },
        {
          "id" : 4,
          "save_name" : "upload\/nav\/5f2d3809e5255.jpg",
          "file_name" : "5e9bb9d9168c3.jpg",
          "mime_type" : "image\/jpeg",
          "file_size" : 24746,
          "ext_name" : "jpg",
          "file_md5" : "86838467119e6ab70cbeea58eddb74a5",
          "file_sha1" : "42e4a62fc0525262966592e45d265c4ae15aacd9",
          "create_time" : 1596798985,
          "used_time" : 0,
          "delete_time" : 0,
          "clear_time" : 0,
          "type" : 6,
          "status" : 0
        },
        {
          "id" : 5,
          "save_name" : "upload\/nav\/5f2d38144d692.jpg",
          "file_name" : "5e9bb9cebc5ad.jpg",
          "mime_type" : "image\/jpeg",
          "file_size" : 29268,
          "ext_name" : "jpg",
          "file_md5" : "d90bb9f54b8ca86c80353f9554a104be",
          "file_sha1" : "a9e4e51f6cdfbbccfe3f925e0c5a3adc845a59c5",
          "create_time" : 1596798996,
          "used_time" : 0,
          "delete_time" : 0,
          "clear_time" : 0,
          "type" : 6,
          "status" : 0
        },
        {
          "id" : 6,
          "save_name" : "upload\/nav\/5f2d382c98e12.jpg",
          "file_name" : "5e9bb9c4e36a7.jpg",
          "mime_type" : "image\/jpeg",
          "file_size" : 39635,
          "ext_name" : "jpg",
          "file_md5" : "07fdf0c869a1e500bfc02688e7c63db4",
          "file_sha1" : "9cc2858685d89137ec6315e61c2df767ff64853a",
          "create_time" : 1596799020,
          "used_time" : 0,
          "delete_time" : 0,
          "clear_time" : 0,
          "type" : 6,
          "status" : 0
        },
        {
          "id" : 7,
          "save_name" : "upload\/nav\/5f2d3833a402d.jpg",
          "file_name" : "5e9bb9aaecdcc.jpg",
          "mime_type" : "image\/jpeg",
          "file_size" : 18107,
          "ext_name" : "jpg",
          "file_md5" : "8e7104e94ab1cb641dfb3bee60f207dc",
          "file_sha1" : "90dbb4bec79ca3c634b861a0bf9f1d90b53075a4",
          "create_time" : 1596799027,
          "used_time" : 0,
          "delete_time" : 0,
          "clear_time" : 0,
          "type" : 6,
          "status" : 0
        },
        {
          "id" : 8,
          "save_name" : "upload\/nav\/5f2d39b6b49da.jpg",
          "file_name" : "5e9bb1f00b329.jpg",
          "mime_type" : "image\/jpeg",
          "file_size" : 289454,
          "ext_name" : "jpg",
          "file_md5" : "3b1b79b7bfda8e8841538b7291782506",
          "file_sha1" : "c643020d2af904b56e93d8269145cd698d663506",
          "create_time" : 1596799414,
          "used_time" : 0,
          "delete_time" : 0,
          "clear_time" : 0,
          "type" : 6,
          "status" : 0
        },
        {
          "id" : 9,
          "save_name" : "upload\/nav\/5f2d39c21ca75.jpg",
          "file_name" : "5e9bb1c4588f4.jpg",
          "mime_type" : "image\/jpeg",
          "file_size" : 325781,
          "ext_name" : "jpg",
          "file_md5" : "7eb83361c57dc762493d937381938176",
          "file_sha1" : "ae14a72aa0c741ab83badad92d0297c21d89e284",
          "create_time" : 1596799426,
          "used_time" : 0,
          "delete_time" : 0,
          "clear_time" : 0,
          "type" : 6,
          "status" : 0
        },
        {
          "id" : 10,
          "save_name" : "upload\/article\/5f2d3bc64acf9.jpg",
          "file_name" : "5e9c078973c3f.jpg",
          "mime_type" : "image\/jpeg",
          "file_size" : 36094,
          "ext_name" : "jpg",
          "file_md5" : "5fea6fb1e60a899f8c1dcd5e6c2c397f",
          "file_sha1" : "b9bd0a045b3a42f10be36d3c993b083146f5e059",
          "create_time" : 1596799942,
          "used_time" : 0,
          "delete_time" : 0,
          "clear_time" : 0,
          "type" : 4,
          "status" : 0
        },
        {
          "id" : 11,
          "save_name" : "upload\/article\/5f2d3bf142a3f.jpg",
          "file_name" : "5e9bc913a67f7.jpg",
          "mime_type" : "image\/jpeg",
          "file_size" : 16237,
          "ext_name" : "jpg",
          "file_md5" : "fb222c2567c4775ec918cc9ca80729e6",
          "file_sha1" : "2afc520f133e3108294a08137f2304effadfd206",
          "create_time" : 1596799985,
          "used_time" : 0,
          "delete_time" : 0,
          "clear_time" : 0,
          "type" : 4,
          "status" : 0
        },
        {
          "id" : 12,
          "save_name" : "upload\/article\/5f2d3c34b8de0.jpg",
          "file_name" : "5e9bc913a67f7.jpg",
          "mime_type" : "image\/jpeg",
          "file_size" : 16237,
          "ext_name" : "jpg",
          "file_md5" : "fb222c2567c4775ec918cc9ca80729e6",
          "file_sha1" : "2afc520f133e3108294a08137f2304effadfd206",
          "create_time" : 1596800052,
          "used_time" : 0,
          "delete_time" : 0,
          "clear_time" : 0,
          "type" : 4,
          "status" : 0
        },
        {
          "id" : 13,
          "save_name" : "upload\/article\/5f2d3ca931e3e.jpg",
          "file_name" : "5e9bcaa66e936.jpg",
          "mime_type" : "image\/jpeg",
          "file_size" : 19089,
          "ext_name" : "jpg",
          "file_md5" : "23e3cf886844a7287f16c2583dbef583",
          "file_sha1" : "a8bed3401d0379123c1f5ce0419f9452bbb85d06",
          "create_time" : 1596800169,
          "used_time" : 0,
          "delete_time" : 0,
          "clear_time" : 0,
          "type" : 4,
          "status" : 0
        },
        {
          "id" : 14,
          "save_name" : "upload\/article\/5f2d3d5c2a3f4.jpg",
          "file_name" : "5e9bcaa66e936.jpg",
          "mime_type" : "image\/jpeg",
          "file_size" : 19089,
          "ext_name" : "jpg",
          "file_md5" : "23e3cf886844a7287f16c2583dbef583",
          "file_sha1" : "a8bed3401d0379123c1f5ce0419f9452bbb85d06",
          "create_time" : 1596800348,
          "used_time" : 0,
          "delete_time" : 0,
          "clear_time" : 0,
          "type" : 4,
          "status" : 0
        },
        {
          "id" : 15,
          "save_name" : "upload\/article\/5f2d3da78c4d0.jpg",
          "file_name" : "5e9bc913a67f7.jpg",
          "mime_type" : "image\/jpeg",
          "file_size" : 16237,
          "ext_name" : "jpg",
          "file_md5" : "fb222c2567c4775ec918cc9ca80729e6",
          "file_sha1" : "2afc520f133e3108294a08137f2304effadfd206",
          "create_time" : 1596800423,
          "used_time" : 0,
          "delete_time" : 0,
          "clear_time" : 0,
          "type" : 4,
          "status" : 0
        },
        {
          "id" : 16,
          "save_name" : "upload\/article\/5f2d3e215d5df.jpg",
          "file_name" : "5e9c0dfe53674.jpg",
          "mime_type" : "image\/jpeg",
          "file_size" : 111147,
          "ext_name" : "jpg",
          "file_md5" : "58a3ee19fdd8c6473532ca9463b90077",
          "file_sha1" : "d73acd1dc4592a29f0fd347f7e1792177206eb9a",
          "create_time" : 1596800545,
          "used_time" : 0,
          "delete_time" : 0,
          "clear_time" : 0,
          "type" : 4,
          "status" : 0
        },
        {
          "id" : 17,
          "save_name" : "upload\/article\/5f2d3e3e8ccad.jpg",
          "file_name" : "5e9c0dfe53674.jpg",
          "mime_type" : "image\/jpeg",
          "file_size" : 111147,
          "ext_name" : "jpg",
          "file_md5" : "58a3ee19fdd8c6473532ca9463b90077",
          "file_sha1" : "d73acd1dc4592a29f0fd347f7e1792177206eb9a",
          "create_time" : 1596800574,
          "used_time" : 0,
          "delete_time" : 0,
          "clear_time" : 0,
          "type" : 4,
          "status" : 0
        },
        {
          "id" : 18,
          "save_name" : "upload\/site_logo\/5f2d3f46a62ac.png",
          "file_name" : "d852498b623c42b8144733cea7253448.png",
          "mime_type" : "image\/png",
          "file_size" : 8866,
          "ext_name" : "png",
          "file_md5" : "0fc686e92a5c9d697b9adf023bf5f697",
          "file_sha1" : "76682ba497968c24cc5ff5502887ef9b69bd159c",
          "create_time" : 1596800838,
          "used_time" : 1596800849,
          "delete_time" : 0,
          "clear_time" : 0,
          "type" : 1,
          "status" : 1
        }
      ]}
      ';

    $list = json_decode($data_content, true);

    foreach ($list['ul_upload_files'] as $item) {
      UploadFiles::create($item);
    }
  }
}
